/**
 * \class GenStmt.cpp
 *
 *  Created on: 5 apr 2011
 *      Author: ytc0039
 */

#include "GenStmt.h"
#include <AbsSyn/IStmt.h>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <RandomPkg/Randomizer.h>

GenStmt::GenStmt() {
	srand((unsigned)time(0));

}

GenStmt::~GenStmt() {

}


const IStmt* GenStmt::GenerateStmt() {

	IStmt *ret=NULL;
	RandomPkg::Randomizer randGen;
	STMT_LIST item  = static_cast<STMT_LIST> ( randGen.createRandom(0,NR_OF_STMT) );
	//STMT_LIST item  = static_cast<STMT_LIST> (rand()%NR_OF_STMT);

	switch(item)
	{
	case ASSIGNMENT:
		/**
		 * \todo FIX Generate Stmt
		 * Need to generate an expression and an ident.
		 * */
		ret = NULL;
		break;
	case DECLARATION:
		/*need to generate an ident,expr and a type
		 *
		 *  1. Generate a type!
		 *  2. an ident
		 *  3. and finally connect the ident with type and expression.
		 *
		 * */
		//ret = new Declaration()

		ret = NULL;
		break;
	default:
		break;
	}

	return ret;
}
